<template>
<div>
  <div class="container">
    <div class="row clearfix">
      <div class="col-md-4 column">
      </div>
      <div class="col-md-4 column">
        <h3>
          提交签到系统
        </h3>
          <div class="form-group">
            <label for="exampleInputEmail1">学号</label><input type="text" v-model="studentId" class="form-control" id="exampleInputEmail1" />
          </div>
               <button type="submit" class="btn btn-default" v-on:click="subReach">签到</button>
      </div>
      <div class="col-md-4 column">
      </div>
    </div>
  </div>
</div>
</template>

<script>
export default {
  created() {
      this.course = this.$route.query.course
      this.teacherName = this.$route.query.teacherName
  },
  name: "Reach",
  data(){
    return{
      teacherName : "",
      course : "",
      studentId : ""
    }
  },
  methods:{
    subReach(){
      this.$ajax.post(base_url + "student/sub_reach",{
        reachStudentId : this.studentId,
        reachCourse : this.course,
        reachTeacher : this.teacherName
      }).then(response => {
        if (response.data.code == 200) {
          alert("签到成功")
        }else {
          alert("签到失败")
        }
      })
    }
  }
}
</script>

<style scoped>

</style>